home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Toolkit for Nursing Excel…t End of Life Transition
/
Toolkit for Nursing Excellence at End of Life Transition.iso
/
StartTneel.hta
< prev
next >
Wrap
Text File
|
2001-10-31
|
14KB
|
435 lines
<HTA:APPLICATION ICON=tneelne.ico
APPLICATIONNAME = "tneel-ne"
WINDOWSTATE = "maximize"
BORDERSTYLE = "complex"
SINGLEINSTANCE = "yes"
NAVIGABLE = "yes">
<HEAD>
<TITLE>TNEEL-NE</TITLE>
<SCRIPT LANGUAGE="javascript">
var newWindow
function displayResults(htmlTags) {
// Displays the results of a search in a new window
var head = "<HTML><HEAD><TITLE>Search Results</TITLE></HEAD><BODY>"
var tail = "</BODY></HTML>"
newWindow = window.open("","searchResults",config='height=200, width=400, left=0, top=0, toolbar=no,scrollbars=yes,resizable=yes')
newWindow.opener=window
newWindow.document.open()
newWindow.document.writeln(head)
newWindow.document.writeln(htmlTags)
newWindow.document.writeln(tail)
newWindow.document.close()
newWindow.focus()
}
function ShowPage(pagename) {
var sourcepath
sourcepath = getsourceTneelPath()
parent.frames(0).gotopage(sourcepath,pagename)
}
</SCRIPT>
<SCRIPT LANGUAGE="vbscript">
dim gDriveLetter
gDriveLetter=""
createShortcut()
'************************************************************************************************
function MiniSearch(searchterm)
'this function uses the file searchfiles.csv to search for html files containing searchterm
'searches content, activities, and case studies sections only
Dim fso
dim isin
dim filestosearch
dim filestosearchtemp
dim filestosearchbuffer
dim pagetosearch
dim pagebuffer
dim sourcepath
dim searchfilespath
dim temphtm
dim searchString
dim count
dim searchingmessage
On Error Resume Next
sourcepath = getsourceTneelPath()
searchfilespath = sourcepath + "searchfiles.csv"
Set searchingmessage = window.showModelessDialog(sourcepath + "search/dialog.htm","","dialogHeight: 80px; dialogWidth: 240px; center: Yes; help: No; resizable: No; status: No; scroll: No;")
if left(searchterm,1)="/" then
searchterm=searchterm.source 'get source of regular expression
end if
searchString=searchterm
searchterm = Trim(LCase(searchterm))
document.frames.item(0).searchterm = searchterm
Set fso = CreateObject("Scripting.FileSystemObject")
Set filestosearch = fso.OpenTextFile(searchfilespath)
temphtm = "<a class='definitionbold'>Results of search for: " + searchString + "</a><p>"
count=0
Do While NOT filestosearch.AtEndOfStream
filestosearchtemp = filestosearch.ReadLine
if inStr(filestosearchtemp,"cont.htm")>0 or inStr(filestosearchtemp,"act.htm")>0 or inStr(filestosearchtemp,"case.htm")>0 then
filestosearchbuffer = Left(filestosearchtemp, InStr(filestosearchtemp, "@") - 1)
Set pagetosearch = fso.OpenTextFile(sourcepath & filestosearchbuffer)
pagebuffer = pagetosearch.ReadAll
pagebuffer = LCase(pagebuffer)
isin = InStr(pagebuffer, searchterm)
if (isin > 0) then
filestosearchbuffer = Replace(filestosearchtemp,"@", "')"">")
temphtm = temphtm + " <a class='ixlink' href=""javascript:window.opener.parent.frames(0).gotopage('" & sourcepath & "', '" & filestosearchbuffer & "</a><br>"
count=count+1
end if
pagetosearch.Close
end if
Loop
filestosearch.Close
if count=0 then
temphtm=temphtm+" No documents found."
end if
displayResults(temphtm) 'Call function to show search results in a popup window
searchingmessage.close()
set fso=Nothing
end function
'************************************************************************************************
function SearchFiles(searchterm)
'this search function uses the file searchfiles.csv to search for html files containing searchterm
Dim fso
dim isin
dim filestosearch
dim filestosearchtemp
dim filestosearchbuffer
dim pagetosearch
dim pagebuffer
dim sourcepath
dim searchfilespath
dim temphtm
dim searchString
dim count
dim searchingmessage
On Error Resume Next
sourcepath = getsourceTneelPath()
searchfilespath = sourcepath + "searchfiles.csv"
Set searchingmessage = window.showModelessDialog(sourcepath + "search/dialog.htm","","dialogHeight: 80px; dialogWidth: 240px; center: Yes; help: No; resizable: No; status: No; scroll: No;")
if left(searchterm,1)="/" then
searchterm=searchterm.source 'get source of regular expression
end if
searchString=searchterm
searchterm = Trim(LCase(searchterm))
document.frames.item(0).searchterm = searchterm
Set fso = CreateObject("Scripting.FileSystemObject")
Set filestosearch = fso.OpenTextFile(searchfilespath)
temphtm = "<a class='definitionbold'>Results of search for: " + searchString + "</a><p>"
count=0
Do While NOT filestosearch.AtEndOfStream
filestosearchtemp = filestosearch.ReadLine
filestosearchbuffer = Left(filestosearchtemp, InStr(filestosearchtemp, "@") - 1)
Set pagetosearch = fso.OpenTextFile(sourcepath & filestosearchbuffer)
pagebuffer = pagetosearch.ReadAll
pagebuffer = LCase(pagebuffer)
isin = InStr(pagebuffer, searchterm)
if (isin > 0) then
filestosearchbuffer = Replace(filestosearchtemp,"@", "')"">")
temphtm = temphtm + " <a class='ixlink' href=""javascript:window.opener.parent.frames(0).gotopage('" & sourcepath & "', '" & filestosearchbuffer & "</a><br>"
count=count+1
end if
pagetosearch.Close
Loop
filestosearch.Close
if count=0 then
temphtm=temphtm+" No documents found."
end if
displayResults(temphtm) 'Call function to show search results in a popup window
searchingmessage.close()
set fso=Nothing
end function
'************************************************************************************************
function exithta()
window.open("inst_eva.htm")
Set WshShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCR\.mp3\", "mp3file"
end function
'************************************************************************************************
function SaveFiles(pageName)
'This function saves the files from each page to the user's selected drive
'pageName=#filename for saving single files, pagename="multifile" for saving multiple files
'multiple files are saved by copying all files except .htm files from the module source folder
window.focus()
On Error Resume Next
dim i, msg, strTemp, response
dim destDriveLetter
dim fileName1, folderName, fso, drv, fldr, fil, fileTemp
dim destFolderName
dim destPathAndName
dim sourceFolderName
dim sourceTneelPath
dim sourcePathAndName
dim thisFolder
dim yesNoCopy
dim numFilesCopied
dim sourcePathConstruction
dim destPathConstruction
dim LineRead
dim destPath()
dim sourcePath()
dim FileToBeSaved()
dim callingmodule
dim file1
dim file2
dim SavingMessageWindow
callingmodule = window.frames(1).document.frames(2).location
callingmodule=ucase(callingmodule)
callingmodule = Right(callingmodule, Len(callingmodule) - inStrRev(callingmodule, "/"))
if left(callingmodule, 1)="#" or right(callingmodule, 1)="#" then
callingmodule = replace(callingmodule, "#", "")
end if
' get rid off #video or #audiocase
if instr(callingmodule, "#")>0 then
callingmodule = left(callingmodule, instr(callingmodule, "#")-1)
end if
if left(PageName, 1)="#" then
PageName=replace(PageName, "#", "")
end if
savebutton = ucase(pagename)
sourceTneelPath = getsourceTneelPath() 'Getting the path for the csv file
if sourceTneelPath = "" then
msgbox "You need to put CD disk back to the CD-ROM drive if you run the program on CD disk.", vbokonly, "Tneel-NE"
exit function
end if
' Opening the file, savefiles.txt, read the infor and assigned to the three dyname array variables.
set fso=CreateObject("Scripting.FileSystemObject")
fileNameAndPath=sourcetneelpath & "savefiles.txt"
set filename1=fso.opentextfile(filenameandpath)
i = 1
do while not filename1.AtEndOfStream
LineRead = filename1.ReadLine
Linefield=split(lineread, ",")
linefield(0)=ucase(linefield(0))
linefield(1)=ucase(linefield(1))
if linefield(0)=callingmodule and linefield(1)=savebutton then
redim preserve fileToBeSaved(i)
redim preserve sourcepath(i)
redim preserve destpath(i)
filetobesaved(i)=linefield(2)
sourcepath(i)=linefield(3)
destpath(i)=linefield(4)
i=i+1
end if
loop
NumOfFiles = i-1
filename.close
' Checking if the root path user entered exists. If not create one.
if gDriveLetter ="" then
destDriveLetter = getDestDriveLetter()
else
destDriveLetter=gDriveLetter
End if
Set SavingMessageWindow = window.showModelessDialog("SavingIndicator.htm","2","dialogHeight: 80px; dialogWidth: 240px; center: Yes; help: No; resizable: No; status: No; scroll: No;")
destPathConstruction=split(destDriveLetter, "\")
destDr = destpathconstruction(0)
for i = 1 to ubound(destpathconstruction)
destDr = destDr & "\" & destPathConstruction(i)
if fso.FolderExists(destDr) = false then
fso.CreateFolder(destDr)
end if
Next
' Adding the UserLocation path to the root path that user selected. Checking the folder
' or the file exists. If it does, copy the file. If not, create the path and then copy the file.
for i = 1 to NumOfFiles
destpathconstruction2=split(destpath(i), "\")
destpath2 = destDr & "\"
for j = 0 to ubound(destpathconstruction2)-1
destpath2 = destpath2 & destpathconstruction2(j)
if fso.FolderExists(destpath2)=false then
fso.CreateFolder(destpath2)
end if
destpath2=destpath2 & "\"
next ' After this loop, destpath2 has the dest. path
'checking and/or copying files from sourcePath to destpath
SourcePathAndName=getSourceTneelPath & SourcePath(i) & filetobesaved(i)
destPathAndName = destpath2 & filetobesaved(i)
set file1 = fso.getfile(destPathAndName)
if file1.name <> filetobesaved(i) then
fso.copyfile SourcePathAndName, destPathAndName
set file2 = fso.getfile(destPathAndName)
if not isnull(file2.name) then
file2.attributes = 0
else
msgbox "The file that you wanted to save has not been saved. Please contact tech support for help.", vbOkonly+vbinformation, "Tneel-ne message"
end if
end if
next
SavingMessageWindow.close()
msgbox "The file saving work has completed.", vbOKOnly+VBINFORMATION, "Tneel-ne Message"
set fso=nothing
end function
'************************************************************************************************
function getsourceTneelPath()
On Error Resume Next
dim validDrive
validDrive = 0
validdrive=window.top.document.location
validdrive=replace(validdrive, "file:///", "")
validDrive = Left(validDrive, inStrRev(validDrive, "/"))
validDrive = replace(validDrive, "%20", " ")
validDrive = replace(validDrive, "%23", "#")
validDrive = replace(validDrive, "%25", "%")
validDrive = replace(validDrive, "%7b", "{")
validDrive = replace(validDrive, "%7d", "}")
validDrive = replace(validDrive, "%5e", "^")
validDrive = replace(validDrive, "%7e", "~")
validDrive = replace(validDrive, "%5b", "[")
validDrive = replace(validDrive, "%5d", "]")
validDrive = replace(validDrive, "%60", "'")
validDrive = replace(validDrive, "%26", "&")
getsourceTneelPath = validDrive
end function
'************************************************************************************************
function getDestDriveLetter()
On Error Resume Next
dim strTemp
dim showDriveLetterWindow
if gDriveLetter = "" then 'if this is the first save during this run
gDriveLetter=showModalDialog("driveletter.htm","1","dialogWidth:450px; dialogHeight:240px")
END IF
getDestDriveLetter = gDriveLetter
end function
'************************************************************************************************
function createShortcut()
'if it already exists it will be re-written
on error resume next
dim sourceTneelPath
dim WshShell
dim oShellLink
dim DesktopPath
dim MyDocsPath
dim fso
dim file1
dim fileSource, fileDest
sourceTneelPath = getsourceTneelPath()
if sourceTneelPath = "0" then
alert("Please insert the TNEEL CD into your CDROM drive.")
exit function
else
'alert("got sourceTneelPath, = " & sourceTneelPath)
end if
Set WshShell = CreateObject("WScript.Shell")
' make sure that mplayer2 is registered to play .mp3 files.
tempvar = WSHShell.RegRead ("HKEY_USERS\.DEFAULT\Software\Microsoft\MediaPlayer\Setup\CreatedLinks\AppName")
if tempvar = "" then
WSHShell.RegWrite "HKEY_USERS\.DEFAULT\Software\Microsoft\MediaPlayer\Setup\CreatedLinks\AppName", "C:\Program Files\Windows Media Player\mplayer2.exe"
tempvar = "C:\Program Files\Windows Media Player\mplayer2.exe"
end if
WSHShell.RegWrite "HKCR\.mp3\", "mp3file"
WSHShell.RegWrite "HKCR\.mp3\Content Type\", "audio/mpeg"
WSHShell.RegWrite "HKCR\mp3file\shell\open\command\", """" + tempvar + """" + " /Open " + """" + "%L" + """"
WSHShell.RegWrite "HKCR\mp3file\shell\open\command\", """" + tempvar + """" + " /Play " + """" + "%L" + """"
DesktopPath = WSHShell.SpecialFolders("Desktop")
Set oShellLink = WshShell.CreateShortcut(DesktopPath & "\tneel-ne.lnk")
oShellLink.TargetPath = sourceTneelPath & "StartTneel.hta"
MyDocsPath = WSHShell.SpecialFolders("MyDocuments")
if (MyDocsPath <> "") then
fileSource = sourceTneelPath & "tneelne.ico"
fileDest = MyDocsPath & "\tneelne.ico"
set fso=CreateObject("Scripting.FileSystemObject")
fso.CopyFile fileSource, fileDest
oShellLink.IconLocation = fileDest
else
oShellLink.IconLocation = sourceTneelPath & "tneelne.ico"
end if
oShellLink.Save
end function
</script>
</HEAD>
<frameset rows="1,*" cols="*" border="0" framespacing="0" frameborder="NO" onUnload="exithta()">
<frame src="browser_bar.htm" name="browser_bar" frameborder="NO" APPLICATION="yes" scrolling="no">
<FRAMESET id="mainframe">
<FRAME SRC="splash.html" ID="frameone" APPLICATION="yes">
</FRAMESET>
</frameset>
</html>